﻿@using Webdiyer.WebControls.Mvc
@model Webdiyer.WebControls.Mvc.PagedList<WorkTimePrj.Models.vwVOT>
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>休假加班管理</title>
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/ClearFloat.css")" rel="stylesheet" type="text/css" />
    <style type="text/css">
        body { color: #000000; }
        h2 { width: 97%; margin: 10px auto; font-size: 10.5pt; /*font-family:simsun;*/ background: #197B30; height: 35px; line-height: 35px; color: #ffffff; }
        .WP_1 { width: 97%; margin: 0 auto 15px auto; font-family: simsun; }
        h2 span { display: block; float: left; margin-left: 10px; }
        .Btn01 { border: solid 1px #5381B3; color: #5381B3; line-height: 24px; height: 24px; }
        input[type='text'].TB01 { width: 135px; }
        table { border-collapse: collapse; border: solid 1px #A5A5A5; width: 97%; margin: 0 auto; }
        table tr th { background: #197B30; color: #ffffff; border-right: solid 1px #A5A5A5; border-bottom: solid 1px #A5A5A5; font-weight: bold; font-size: 10pt; }
        table tr td { font-family: simsun,Arial,simsun,Verdana; /*font-size:10pt;*/ text-align: center; color: #000000; border-right: solid 1px #A5A5A5; border-bottom: solid 1px #A5A5A5; }
        .WP_2 { font-size: 14px; margin-top: 15px; }
        .Link { text-decoration: underline; }
        .WP_3 { float: left; }
        .WP_4 { margin: 0 auto; width: 40px; }
        .WP_5 { margin: 0 auto; width: 70px; }
        .Order { width: 8px; float: right; }
        .OrderUp { background: url(/WorkTimePrj/Content/Img/arrow_up_05.jpg) no-repeat; width: 8px; height: 4px; display: block; /*float:left;*/ margin-bottom: 5px; }
        .OrderDown { background: url(/WorkTimePrj/Content/Img/arrow_down_05.jpg) no-repeat; width: 8px; height: 4px; display: block; /*float:left;*/ }
    </style>
    <script src="@Url.Content("~/Scripts/jquery-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('.OrderUp').hover(function () {
                $(this).css({ 'cursor': 'pointer' });
            },
            function () {
                $(this).css({ 'cursor': 'default' });
            });
            $('.OrderDown').hover(function () {
                $(this).css({ 'cursor': 'pointer' });
            },
            function () {
                $(this).css({ 'cursor': 'default' });
            });
        });
        function JsonDelete_OnComplete(context) {

            var JsonDelete = context.get_response().get_object();

            if (JsonDelete.msg == '1') {
                alert('删除成功！');
                window.location.reload();
            }
            else
                alert('删除失败！');
        }
    </script>
</head>
<body>
    <h2>
        <span>休假加班数据</span>
    </h2>
    <div class="WP_1">
        <span>时间 @ViewBag.startTime.ToString("yyyy-MM-dd") 至 @ViewBag.endTime.ToString("yyyy-MM-dd")</span>&nbsp;
        &nbsp; &nbsp;<span>总共 @ViewBag.cnt 条数据</span>&nbsp;&nbsp;&nbsp;
        <input type="button" value="上一周" onclick="window.location.href='@Url.Action("VOTList", new { startTime = ViewBag.startTime.AddDays(-7), endTime = ViewBag.endTime.AddDays(-7) })'" class="Btn01"/>
        @if (ViewBag.startTime.AddDays(7) < DateTime.Now)
        {
            <span>&nbsp; &nbsp;</span>
            <input type="button" value="下一周" onclick="window.location.href='@Url.Action("VOTList", new { startTime = ViewBag.startTime.AddDays(7), endTime = ViewBag.endTime.AddDays(7) })'" class="Btn01"/>
        }
        &nbsp; &nbsp;<input id="Button1" type="button" value="新增" class="Btn01" onclick="window.open('@Url.Action("AddVacOT", new { startTime = ViewBag.startTime, endTime = ViewBag.endTime })')"/>&nbsp;&nbsp;&nbsp;
        <input class="Btn01" id="BtnExcel" type="button" value="导出Excel" onclick="window.open('@Url.Action("ExportVOT", new { startTime = ViewBag.startTime, endTime = ViewBag.endTime, pagenum = ViewBag.pagenum })')"/>
    </div>
    <table border="1">
        <tr>
            <th style="width: 10%">
                序号
            </th>
            <th style="width: 10%">
                <div class="WP_4 group">
                    <div class="WP_3">
                        姓名</div>
                    <div class="Order group">
                        <span class="OrderUp" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "DisplayName asc" })'">
                        </span><span class="OrderDown" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "DisplayName desc" })'">
                        </span>
                    </div>
                </div>
            </th>
            <th>
                <div class="WP_4 group">
                    <div class="WP_3">
                        类型</div>
                    <div class="Order group">
                        <span class="OrderUp" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "Type asc" })'">
                        </span><span class="OrderDown" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "Type desc" })'">
                        </span>
                    </div>
                </div>
            </th>
            <th>
                开始日期
            </th>
            <th>
                结束日期
            </th>
            <th>
                <div class="WP_4 group">
                    <div class="WP_3">
                        时长</div>
                    <div class="Order group">
                        <span class="OrderUp" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "hour asc" })'">
                        </span><span class="OrderDown" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "hour desc" })'">
                        </span>
                    </div>
                </div>
            </th>
            <th>
                <div class="WP_5 group">
                    <div class="WP_3">
                        添加用户</div>
                    <div class="Order group">
                        <span class="OrderUp" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "addUser asc" })'">
                        </span><span class="OrderDown" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "addUser desc" })'">
                        </span>
                    </div>
                </div>
            </th>
            <th>
                <div class="WP_5 group">
                    <div class="WP_3">
                        添加时间</div>
                    <div class="Order group">
                        <span class="OrderUp" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "addTime asc" })'">
                        </span><span class="OrderDown" onclick="window.location.href='@Url.Action("VOTList", new { id = 1, startTime = ViewBag.startTime, endTime = ViewBag.endTime, orderBy = "addTime desc" })'">
                        </span>
                    </div>
                </div>
            </th>
            <th>
            </th>
        </tr>
        @Html.EditorForModel()
    </table>
    <div style="margin: 20px;">
        @Html.Pager(Model, new Webdiyer.WebControls.Mvc.PagerOptions { PageIndexParameterName = "id" })
    </div>
</body>
</html>
